{ *** cef_drag_data_capi.h  *** }

  PCefDragData = ^TCefDragData;

  // Structure used to represent drag data. The functions of this structure may be
  // called on any thread.
  TCefDragData = record
    // Base structure.
    base: TCefBase;

    // Returns a copy of the current object.
    clone: function(self: PCefDragData): PCefDragData; cconv;

    // Returns true (1) if this object is read-only.
    is_read_only: function(self: PCefDragData): Integer; cconv;

    // Returns true (1) if the drag data is a link.
    is_link: function(self: PCefDragData): Integer; cconv;

    // Returns true (1) if the drag data is a text or html fragment.
    is_fragment: function(self: PCefDragData): Integer; cconv;

    // Returns true (1) if the drag data is a file.
    is_file: function(self: PCefDragData): Integer; cconv;

    // Return the link URL that is being dragged.
    //
    // The resulting string must be freed by calling cef_string_userfree_free().
    get_link_url: function(self: PCefDragData): PCefStringUserFree; cconv;

    // Return the title associated with the link being dragged.
    //
    // The resulting string must be freed by calling cef_string_userfree_free().
    get_link_title: function(self: PCefDragData): PCefStringUserFree; cconv;

    // Return the metadata, if any, associated with the link being dragged.
    //
    // The resulting string must be freed by calling cef_string_userfree_free().
    get_link_metadata: function(self: PCefDragData): PCefStringUserFree; cconv;

    // Return the plain text fragment that is being dragged.
    //
    // The resulting string must be freed by calling cef_string_userfree_free().
    get_fragment_text: function(self: PCefDragData): PCefStringUserFree; cconv;

    // Return the text/html fragment that is being dragged.
    //
    // The resulting string must be freed by calling cef_string_userfree_free().
    get_fragment_html: function(self: PCefDragData): PCefStringUserFree; cconv;

    // Return the base URL that the fragment came from. This value is used for
    // resolving relative URLs and may be NULL.
    //
    // The resulting string must be freed by calling cef_string_userfree_free().
    get_fragment_base_url: function(self: PCefDragData): PCefStringUserFree; cconv;

    // Return the name of the file being dragged out of the browser window.
    //
    // The resulting string must be freed by calling cef_string_userfree_free().
    get_file_name: function(self: PCefDragData): PCefStringUserFree; cconv;

    // Write the contents of the file being dragged out of the web view into
    // |writer|. Returns the number of bytes sent to |writer|. If |writer| is NULL
    // this function will return the size of the file contents in bytes. Call
    // get_file_name() to get a suggested name for the file.
    get_file_contents: function(self: PCefDragData; writer: PCefStreamWriter): SIZE_T; cconv;

    // Retrieve the list of file names that are being dragged into the browser
    // window.
    get_file_names: function(self: PCefDragData; names: TCefStringList): Integer; cconv;

    // Set the link URL that is being dragged.
    set_link_url: procedure(self: PCefDragData; const url: PCefString); cconv;

    // Set the title associated with the link being dragged.
    set_link_title: procedure(self: PCefDragData; const title: PCefString); cconv;

    // Set the metadata associated with the link being dragged.
    set_link_metadata: procedure(self: PCefDragData; const data: PCefString); cconv;

    // Set the plain text fragment that is being dragged.
    set_fragment_text: procedure(self: PCefDragData; const text: PCefString); cconv;

    // Set the text/html fragment that is being dragged.
    set_fragment_html: procedure(self: PCefDragData; const html: PCefString); cconv;

    // Set the base URL that the fragment came from.
    set_fragment_base_url: procedure(self: PCefDragData; const base_url: PCefString); cconv;

    // Reset the file contents. You should do this before calling
    // cef_browser_host_t::DragTargetDragEnter as the web view does not allow us
    // to drag in this kind of data.
    reset_file_contents: procedure(self: PCefDragData); cconv;

    // Add a file that is being dragged into the webview.
    add_file: procedure(self: PCefDragData; const path, display_name: PCefString);
  end;

///
// Create a new cef_drag_data_t object.
cef_drag_data_create = function(): PCefDragData; cconv;

